package com.drop.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Shipaddress entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "shipaddress", catalog = "feature_mall")
public class Shipaddress implements java.io.Serializable {

	// Fields

	private Integer shipId;
	private User user;
	private String shipContent;
	private Set<Order> orders = new HashSet<Order>(0);

	// Constructors

	/** default constructor */
	public Shipaddress() {
	}

	/** full constructor */
	public Shipaddress(User user, String shipContent, Set<Order> orders) {
		this.user = user;
		this.shipContent = shipContent;
		this.orders = orders;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "shipId", unique = true, nullable = false)
	public Integer getShipId() {
		return this.shipId;
	}

	public void setShipId(Integer shipId) {
		this.shipId = shipId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userId")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "shipContent", length = 45)
	public String getShipContent() {
		return this.shipContent;
	}

	public void setShipContent(String shipContent) {
		this.shipContent = shipContent;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "shipaddress")
	public Set<Order> getOrders() {
		return this.orders;
	}

	public void setOrders(Set<Order> orders) {
		this.orders = orders;
	}

}